# 星座运势分析系统

import random
import datetime
from datetime import datetime, timedelta

class ZodiacFortune:
    def __init__(self):
        # 初始化星座数据
        self.zodiac_signs = self._init_zodiac_signs()
        self.planets = self._init_planets()
        self.aspects = self._init_aspects()
        self.houses = self._init_houses()
    
    def _init_zodiac_signs(self):
        """初始化十二星座数据"""
        zodiac_signs = {
            "aries": {
                "name": "白羊座",
                "date_range": "3.21-4.19",
                "element": "火",
                "quality": "基本",
                "ruling_planet": "火星",
                "symbol": "白羊",
                "characteristics": "热情、勇敢、冲动、领导力",
                "strengths": "勇气、决断力、自信、乐观",
                "weaknesses": "急躁、自我中心、冲动、缺乏耐心",
                "lucky_numbers": [1, 9, 10, 19, 28],
                "lucky_colors": ["红色", "橙色"],
                "lucky_days": ["星期二", "星期六"]
            },
            "taurus": {
                "name": "金牛座",
                "date_range": "4.20-5.20",
                "element": "土",
                "quality": "固定",
                "ruling_planet": "金星",
                "symbol": "金牛",
                "characteristics": "稳重、实际、可靠、感性",
                "strengths": "耐心、可靠、负责任、稳定",
                "weaknesses": "固执、占有欲强、不灵活",
                "lucky_numbers": [2, 6, 15, 24, 33],
                "lucky_colors": ["绿色", "粉色"],
                "lucky_days": ["星期五", "星期一"]
            },
            "gemini": {
                "name": "双子座",
                "date_range": "5.21-6.21",
                "element": "风",
                "quality": "变动",
                "ruling_planet": "水星",
                "symbol": "双子",
                "characteristics": "好奇、适应性强、灵活、交际能力强",
                "strengths": "沟通能力、适应性、智慧、多才多艺",
                "weaknesses": "优柔寡断、不专注、紧张、表面化",
                "lucky_numbers": [3, 5, 12, 23, 32],
                "lucky_colors": ["黄色", "蓝色"],
                "lucky_days": ["星期三", "星期日"]
            },
            "cancer": {
                "name": "巨蟹座",
                "date_range": "6.22-7.22",
                "element": "水",
                "quality": "基本",
                "ruling_planet": "月亮",
                "symbol": "巨蟹",
                "characteristics": "情感丰富、有同情心、直觉强、保护欲强",
                "strengths": "忠诚、情感丰富、同情心、想象力",
                "weaknesses": "情绪化、多愁善感、操控欲、不安全感",
                "lucky_numbers": [4, 8, 13, 22, 31],
                "lucky_colors": ["白色", "银色"],
                "lucky_days": ["星期一", "星期四"]
            },
            "leo": {
                "name": "狮子座",
                "date_range": "7.23-8.22",
                "element": "火",
                "quality": "固定",
                "ruling_planet": "太阳",
                "symbol": "狮子",
                "characteristics": "自信、慷慨、忠诚、创造力",
                "strengths": "创造力、热情、慷慨、幽默感",
                "weaknesses": "自负、固执、支配欲、戏剧化",
                "lucky_numbers": [5, 9, 14, 19, 23],
                "lucky_colors": ["金色", "橙色"],
                "lucky_days": ["星期日", "星期三"]
            },
            "virgo": {
                "name": "处女座",
                "date_range": "8.23-9.22",
                "element": "土",
                "quality": "变动",
                "ruling_planet": "水星",
                "symbol": "处女",
                "characteristics": "分析能力强、勤劳、实际、细心",
                "strengths": "分析能力、勤劳、实际、可靠",
                "weaknesses": "挑剔、过度担忧、完美主义、批判性",
                "lucky_numbers": [6, 11, 15, 20, 29],
                "lucky_colors": ["绿色", "棕色"],
                "lucky_days": ["星期三", "星期六"]
            },
            "libra": {
                "name": "天秤座",
                "date_range": "9.23-10.23",
                "element": "风",
                "quality": "基本",
                "ruling_planet": "金星",
                "symbol": "天秤",
                "characteristics": "平衡、和谐、公正、社交",
                "strengths": "合作、外交、公平、社交能力",
                "weaknesses": "优柔寡断、逃避冲突、依赖他人、肤浅",
                "lucky_numbers": [7, 16, 25, 34, 43],
                "lucky_colors": ["粉色", "蓝色"],
                "lucky_days": ["星期五", "星期一"]
            },
            "scorpio": {
                "name": "天蝎座",
                "date_range": "10.24-11.22",
                "element": "水",
                "quality": "固定",
                "ruling_planet": "冥王星",
                "symbol": "天蝎",
                "characteristics": "热情、坚定、神秘、敏感",
                "strengths": "决心、勇气、激情、直觉",
                "weaknesses": "嫉妒、固执、操控、多疑",
                "lucky_numbers": [8, 11, 18, 22, 29],
                "lucky_colors": ["深红色", "黑色"],
                "lucky_days": ["星期二", "星期四"]
            },
            "sagittarius": {
                "name": "射手座",
                "date_range": "11.23-12.21",
                "element": "火",
                "quality": "变动",
                "ruling_planet": "木星",
                "symbol": "射手",
                "characteristics": "乐观、自由、哲学、冒险",
                "strengths": "乐观、自由、诚实、幽默感",
                "weaknesses": "缺乏耐心、承诺恐惧症、直言不讳、鲁莽",
                "lucky_numbers": [9, 18, 27, 36, 45],
                "lucky_colors": ["蓝色", "紫色"],
                "lucky_days": ["星期四", "星期二"]
            },
            "capricorn": {
                "name": "摩羯座",
                "date_range": "12.22-1.19",
                "element": "土",
                "quality": "基本",
                "ruling_planet": "土星",
                "symbol": "山羊",
                "characteristics": "负责任、自律、实际、野心",
                "strengths": "责任感、纪律性、自控力、管理能力",
                "weaknesses": "悲观、固执、冷漠、过于传统",
                "lucky_numbers": [10, 20, 30, 40, 50],
                "lucky_colors": ["棕色", "灰色"],
                "lucky_days": ["星期六", "星期三"]
            },
            "aquarius": {
                "name": "水瓶座",
                "date_range": "1.20-2.18",
                "element": "风",
                "quality": "固定",
                "ruling_planet": "天王星",
                "symbol": "水瓶",
                "characteristics": "独立、人道主义、创新、叛逆",
                "strengths": "独创性、独立性、人道主义、友好",
                "weaknesses": "情感疏离、不可预测、固执、反叛",
                "lucky_numbers": [11, 22, 33, 44, 55],
                "lucky_colors": ["蓝色", "绿松石色"],
                "lucky_days": ["星期六", "星期四"]
            },
            "pisces": {
                "name": "双鱼座",
                "date_range": "2.19-3.20",
                "element": "水",
                "quality": "变动",
                "ruling_planet": "海王星",
                "symbol": "双鱼",
                "characteristics": "富有同情心、直觉、艺术、梦幻",
                "strengths": "同情心、艺术性、直觉、温柔",
                "weaknesses": "逃避现实、过度理想化、牺牲自我、敏感",
                "lucky_numbers": [12, 21, 30, 39, 48],
                "lucky_colors": ["海蓝色", "紫色"],
                "lucky_days": ["星期四", "星期一"]
            }
        }
        return zodiac_signs
    
    def _init_planets(self):
        """初始化行星数据"""
        planets = {
            "sun": {
                "name": "太阳",
                "represents": "核心自我、生命力、创造力、意识",
                "influence": "影响个性核心和自我表达"
            },
            "moon": {
                "name": "月亮",
                "represents": "情感、潜意识、直觉、安全感",
                "influence": "影响情感反应和内在需求"
            },
            "mercury": {
                "name": "水星",
                "represents": "思维、沟通、学习、逻辑",
                "influence": "影响思考方式和表达能力"
            },
            "venus": {
                "name": "金星",
                "represents": "爱情、美、价值观、和谐",
                "influence": "影响爱情观和审美观"
            },
            "mars": {
                "name": "火星",
                "represents": "行动、欲望、能量、勇气",
                "influence": "影响行动力和冲动"
            },
            "jupiter": {
                "name": "木星",
                "represents": "扩张、幸运、智慧、成长",
                "influence": "影响成长和机遇"
            },
            "saturn": {
                "name": "土星",
                "represents": "限制、责任、纪律、耐心",
                "influence": "影响责任感和自律性"
            },
            "uranus": {
                "name": "天王星",
                "represents": "变革、独立、创新、叛逆",
                "influence": "影响创新能力和突破性思维"
            },
            "neptune": {
                "name": "海王星",
                "represents": "梦想、灵感、幻觉、精神性",
                "influence": "影响想象力和灵感"
            },
            "pluto": {
                "name": "冥王星",
                "represents": "转化、权力、再生、深度",
                "influence": "影响深层转变和蜕变"
            }
        }
        return planets
    
    def _init_aspects(self):
        """初始化相位数据"""
        aspects = {
            "conjunction": {
                "name": "合相",
                "angle": 0,
                "influence": "能量融合，增强特质",
                "nature": "中性"
            },
            "sextile": {
                "name": "六分相",
                "angle": 60,
                "influence": "和谐、机遇、流动",
                "nature": "吉相"
            },
            "square": {
                "name": "四分相",
                "angle": 90,
                "influence": "紧张、挑战、动力",
                "nature": "凶相"
            },
            "trine": {
                "name": "三分相",
                "angle": 120,
                "influence": "和谐、才能、流畅",
                "nature": "吉相"
            },
            "opposition": {
                "name": "对分相",
                "angle": 180,
                "influence": "对立、平衡、觉察",
                "nature": "凶相"
            }
        }
        return aspects
    
    def _init_houses(self):
        """初始化宫位数据"""
        houses = {
            1: {
                "name": "第一宫",
                "represents": "自我、外表、个性",
                "influence": "影响个人形象和自我表达"
            },
            2: {
                "name": "第二宫",
                "represents": "财富、价值观、资源",
                "influence": "影响物质安全和价值观"
            },
            3: {
                "name": "第三宫",
                "represents": "沟通、学习、兄弟姐妹",
                "influence": "影响思维方式和交流能力"
            },
            4: {
                "name": "第四宫",
                "represents": "家庭、根基、情感安全",
                "influence": "影响家庭关系和情感基础"
            },
            5: {
                "name": "第五宫",
                "represents": "创造力、爱情、娱乐",
                "influence": "影响创造表达和浪漫关系"
            },
            6: {
                "name": "第六宫",
                "represents": "工作、健康、服务",
                "influence": "影响日常工作和健康状况"
            },
            7: {
                "name": "第七宫",
                "represents": "伴侣关系、合作、公开敌人",
                "influence": "影响一对一关系和合作"
            },
            8: {
                "name": "第八宫",
                "represents": "转变、共享资源、性",
                "influence": "影响深层转变和亲密关系"
            },
            9: {
                "name": "第九宫",
                "represents": "哲学、旅行、高等教育",
                "influence": "影响信仰体系和扩展视野"
            },
            10: {
                "name": "第十宫",
                "represents": "职业、社会地位、权威",
                "influence": "影响事业发展和公众形象"
            },
            11: {
                "name": "第十一宫",
                "represents": "友谊、团体、希望",
                "influence": "影响社交圈和未来愿景"
            },
            12: {
                "name": "第十二宫",
                "represents": "潜意识、秘密、限制",
                "influence": "影响内在世界和精神成长"
            }
        }
        return houses
    
    def get_zodiac_sign(self, birth_date):
        """根据生日确定星座"""
        birth_dt = datetime.strptime(birth_date, "%Y-%m-%d")
        month = birth_dt.month
        day = birth_dt.day
        
        if (month == 3 and day >= 21) or (month == 4 and day <= 19):
            return "aries"
        elif (month == 4 and day >= 20) or (month == 5 and day <= 20):
            return "taurus"
        elif (month == 5 and day >= 21) or (month == 6 and day <= 21):
            return "gemini"
        elif (month == 6 and day >= 22) or (month == 7 and day <= 22):
            return "cancer"
        elif (month == 7 and day >= 23) or (month == 8 and day <= 22):
            return "leo"
        elif (month == 8 and day >= 23) or (month == 9 and day <= 22):
            return "virgo"
        elif (month == 9 and day >= 23) or (month == 10 and day <= 23):
            return "libra"
        elif (month == 10 and day >= 24) or (month == 11 and day <= 22):
            return "scorpio"
        elif (month == 11 and day >= 23) or (month == 12 and day <= 21):
            return "sagittarius"
        elif (month == 12 and day >= 22) or (month == 1 and day <= 19):
            return "capricorn"
        elif (month == 1 and day >= 20) or (month == 2 and day <= 18):
            return "aquarius"
        else:
            return "pisces"
    
    def generate_daily_horoscope(self, birth_date, target_date=None):
        """
        生成每日星座运势
        
        参数:
        birth_date: 用户生日，格式为"YYYY-MM-DD"
        target_date: 目标日期，格式为"YYYY-MM-DD"，默认为当天
        
        返回:
        星座运势结果
        """
        # 如果未指定目标日期，使用当前日期
        if target_date is None:
            target_date = datetime.now().strftime("%Y-%m-%d")
        
        target_dt = datetime.strptime(target_date, "%Y-%m-%d")
        
        # 获取星座
        zodiac_sign = self.get_zodiac_sign(birth_date)
        sign_info = self.zodiac_signs[zodiac_sign]
        
        # 设置随机种子，确保结果的一致性
        seed = (
            target_dt.year * 10000 + target_dt.month * 100 + target_dt.day +
            sum(ord(c) for c in zodiac_sign)
        )
        random.seed(seed)
        
        # 生成运势评分（1-5分）
        scores = {
            "overall": random.randint(1, 5),
            "love": random.randint(1, 5),
            "career": random.randint(1, 5),
            "health": random.randint(1, 5),
            "wealth": random.randint(1, 5)
        }
        
        # 生成幸运信息
        lucky_number = random.choice(sign_info["lucky_numbers"])
        lucky_color = random.choice(sign_info["lucky_colors"])
        lucky_time = f"{random.randint(0, 23)}:00"
        
        # 生成吉凶方位
        directions = ["东", "南", "西", "北", "东北", "东南", "西南", "西北"]
        lucky_direction = random.choice(directions)
        unlucky_direction = random.choice([d for d in directions if d != lucky_direction])
        
        # 生成当日行星影响
        influential_planets = random.sample(list(self.planets.keys()), 3)
        planet_influences = []
        for planet in influential_planets:
            aspect = random.choice(list(self.aspects.keys()))
            house = random.randint(1, 12)
            influence = f"{self.planets[planet]['name']}在{self.houses[house]['name']}形成{self.aspects[aspect]['name']}，{self._generate_planet_influence(planet, aspect, house)}"
            planet_influences.append(influence)
        
        # 生成运势解读
        interpretations = {
            "overall": self._generate_overall_interpretation(zodiac_sign, scores["overall"], target_dt),
            "love": self._generate_love_interpretation(zodiac_sign, scores["love"]),
            "career": self._generate_career_interpretation(zodiac_sign, scores["career"]),
            "health": self._generate_health_interpretation(zodiac_sign, scores["health"]),
            "wealth": self._generate_wealth_interpretation(zodiac_sign, scores["wealth"])
        }
        
        # 生成建议
        advice = self._generate_advice(zodiac_sign, scores, target_dt)
        
        # 返回结果
        result = {
            "date": target_date,
            "zodiac_sign": {
                "name": sign_info["name"],
                "element": sign_info["element"],
                "ruling_planet": sign_info["ruling_planet"]
            },
            "scores": scores,
            "lucky_info": {
                "number": lucky_number,
                "color": lucky_color,
                "time": lucky_time,
                "direction": lucky_direction,
                "unlucky_direction": unlucky_direction
            },
            "planet_influences": planet_influences,
            "interpretations": interpretations,
            "advice": advice
        }
        
        return result
    
    def _generate_planet_influence(self, planet, aspect, house):
        """生成行星影响解读"""
        planet_info = self.planets[planet]
        aspect_info = self.aspects[aspect]
        house_info = self.houses[house]
        
        influences = [
            f"增强您在{house_info['represents']}方面的{planet_info['represents']}",
            f"为您的{house_info['represents']}带来{aspect_info['nature']}的影响",
            f"使您在{house_info['represents']}方面{aspect_info['influence']}"
        ]
        
        return random.choice(influences)
    
    def _generate_overall_interpretation(self, zodiac_sign, score, date):
        """生成总体运势解读"""
        sign_info = self.zodiac_signs[zodiac_sign]
        
        if score >= 4:
            interpretations = [
                f"今天对{sign_info['name']}来说是非常顺利的一天。{sign_info['ruling_planet']}的影响使您充满活力和创造力。",
                f"作为{sign_info['element']}象星座的{sign_info['name']}，今天您将感受到宇宙能量的支持，各方面都有不错的发展。",
                f"今天{sign_info['name']}的运势非常好，您的{sign_info['strengths'].split('、')[0]}特质将帮助您克服各种挑战。"
            ]
        elif score >= 3:
            interpretations = [
                f"今天{sign_info['name']}的运势平稳，虽然没有特别突出的亮点，但也不会有明显的阻碍。",
                f"{sign_info['ruling_planet']}的影响使{sign_info['name']}今天保持平衡状态，适合稳步推进已有计划。",
                f"作为{sign_info['quality']}型的{sign_info['name']}，今天您将体验到平静而稳定的一天。"
            ]
        else:
            interpretations = [
                f"今天{sign_info['name']}可能面临一些挑战，需要特别注意避免{sign_info['weaknesses'].split('、')[0]}的倾向。",
                f"{sign_info['ruling_planet']}的位置不佳，使{sign_info['name']}今天的能量有些低迷，建议保持谨慎。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天可能感到能量不足，需要更多休息和调整。"
            ]
        
        return random.choice(interpretations)
    
    def _generate_love_interpretation(self, zodiac_sign, score):
        """生成爱情运势解读"""
        sign_info = self.zodiac_signs[zodiac_sign]
        
        if score >= 4:
            interpretations = [
                f"今天{sign_info['name']}在感情方面非常顺利，单身者可能遇到心动的对象，有伴侣的人将享受甜蜜时光。",
                f"金星对{sign_info['name']}的影响使您在感情中充满魅力和吸引力，是表达爱意的好时机。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在感情中将展现出热情和真诚，有望获得良好回应。"
            ]
        elif score >= 3:
            interpretations = [
                f"{sign_info['name']}今天的感情运势平稳，适合维护现有关系，但不宜有重大突破。",
                f"今天{sign_info['name']}在感情中保持平衡状态，可以进行温和的交流，但避免敏感话题。",
                f"作为{sign_info['quality']}型的{sign_info['name']}，今天您在感情中既不会有明显进展，也不会有明显倒退。"
            ]
        else:
            interpretations = [
                f"今天{sign_info['name']}在感情方面可能遇到一些挑战，需要避免冲动和误解。",
                f"金星位置不佳，使{sign_info['name']}今天在感情中容易感到不安或失落，建议保持冷静。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在感情中可能过于敏感，需要给自己和伴侣一些空间。"
            ]
        
        return random.choice(interpretations)
    
    def _generate_career_interpretation(self, zodiac_sign, score):
        """生成事业运势解读"""
        sign_info = self.zodiac_signs[zodiac_sign]
        
        if score >= 4:
            interpretations = [
                f"今天{sign_info['name']}在事业方面非常有利，可能获得上司的赏识或项目的突破。",
                f"{sign_info['ruling_planet']}的影响使{sign_info['name']}今天在工作中思维敏捷，创意丰富，是展示才能的好时机。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在职场上将展现出色的{sign_info['strengths'].split('、')[1]}，有望获得认可。"
            ]
        elif score >= 3:
            interpretations = [
                f"{sign_info['name']}今天的事业运势平稳，适合按部就班地完成工作，不宜有冒险行为。",
                f"今天{sign_info['name']}在工作中保持稳定状态，可以处理日常事务，但重大决策可能需要推迟。",
                f"作为{sign_info['quality']}型的{sign_info['name']}，今天您在职场上既不会有特别的机遇，也不会有明显的阻碍。"
            ]
        else:
            interpretations = [
                f"今天{sign_info['name']}在事业方面可能面临一些挑战，需要避免与同事或上司的冲突。",
                f"{sign_info['ruling_planet']}位置不佳，使{sign_info['name']}今天在工作中可能遇到阻碍或延误，建议保持耐心。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在职场上可能感到压力增大，需要调整心态，避免{sign_info['weaknesses'].split('、')[2]}。"
            ]
        
        return random.choice(interpretations)
    
    def _generate_health_interpretation(self, zodiac_sign, score):
        """生成健康运势解读"""
        sign_info = self.zodiac_signs[zodiac_sign]
        
        if score >= 4:
            interpretations = [
                f"今天{sign_info['name']}的健康状况良好，精力充沛，适合进行体育锻炼或户外活动。",
                f"{sign_info['ruling_planet']}的影响使{sign_info['name']}今天身心和谐，免疫力增强，不易受外界干扰。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在健康方面将感受到能量的流动，有助于恢复和调整。"
            ]
        elif score >= 3:
            interpretations = [
                f"{sign_info['name']}今天的健康状况平稳，没有明显不适，但也不宜过度劳累。",
                f"今天{sign_info['name']}在健康方面保持平衡状态，适合保持规律作息，注意饮食均衡。",
                f"作为{sign_info['quality']}型的{sign_info['name']}，今天您的身体状况稳定，但可能需要更多的休息和放松。"
            ]
        else:
            interpretations = [
                f"今天{sign_info['name']}在健康方面需要特别注意，可能感到疲劳或轻微不适。",
                f"{sign_info['ruling_planet']}位置不佳，使{sign_info['name']}今天的免疫力可能有所下降，建议增加休息，避免熬夜。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在健康方面可能感到能量不足，需要通过适当的饮食和休息来调整。"
            ]
        
        return random.choice(interpretations)
    
    def _generate_wealth_interpretation(self, zodiac_sign, score):
        """生成财富运势解读"""
        sign_info = self.zodiac_signs[zodiac_sign]
        
        if score >= 4:
            interpretations = [
                f"今天{sign_info['name']}的财运非常好，可能有意外收入或投资回报。",
                f"{sign_info['ruling_planet']}的影响使{sign_info['name']}今天在财务决策上更为敏锐，是规划或投资的好时机。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在财富方面将获得宇宙能量的支持，有望增加收入或减少支出。"
            ]
        elif score >= 3:
            interpretations = [
                f"{sign_info['name']}今天的财运平稳，收支平衡，不宜有大额消费或投资。",
                f"今天{sign_info['name']}在财务方面保持稳定状态，适合日常理财，但重大财务决策可能需要推迟。",
                f"作为{sign_info['quality']}型的{sign_info['name']}，今天您的财务状况没有明显变化，适合维持现状。"
            ]
        else:
            interpretations = [
                f"今天{sign_info['name']}在财富方面需要谨慎，可能面临意外支出或投资损失。",
                f"{sign_info['ruling_planet']}位置不佳，使{sign_info['name']}今天在财务决策上可能判断失误，建议避免重大交易或投资。",
                f"作为{sign_info['element']}象星座，{sign_info['name']}今天在财富方面可能遇到一些阻碍，需要控制支出，避免冲动消费。"
            ]
        
        return random.choice(interpretations)
    
    def _generate_advice(self, zodiac_sign, scores, date):
        """生成建议"""
        sign_info = self.zodiac_signs[zodiac_sign]
        overall_score = scores["overall"]
        
        # 根据日期和星座特点生成建议
        weekday = date.weekday()
        is_weekend = weekday >= 5
        
        if overall_score >= 4:
            if is_weekend:
                advices = [
                    f"今天是周末高能日，建议{sign_info['name']}充分利用这个好时机，进行社交活动或户外探索。",
                    f"周末运势极佳，{sign_info['name']}可以尝试新事物或开展创意项目，将获得意想不到的收获。",
                    f"今天{sign_info['name']}的能量非常充沛，适合与朋友共度美好时光或进行自我提升活动。"
                ]
            else:
                advices = [
                    f"工作日运势极佳，{sign_info['name']}应把握这个机会，主动争取项目或表达想法。",
                    f"今天{sign_info['name']}的魅力四射，适合进行重要会议或谈判，有望获得支持和认可。",
                    f"工作日高能量，建议{sign_info['name']}集中精力处理最重要的任务，将事半功倍。"
                ]
        elif overall_score >= 3:
            if is_weekend:
                advices = [
                    f"周末运势平稳，{sign_info['name']}适合进行温和的休闲活动，避免过度刺激。",
                    f"今天{sign_info['name']}可以选择在家放松或与亲近的人共度时光，保持平和心态。",
                    f"周末能量适中，建议{sign_info['name']}平衡活动和休息，不要给自己太大压力。"
                ]
            else:
                advices = [
                    f"工作日运势平稳，{sign_info['name']}适合按计划推进工作，避免冒险或改变。",
                    f"今天{sign_info['name']}应保持专注和耐心，一步一步完成任务，不要期望立竿见影。",
                    f"工作日能量适中，建议{sign_info['name']}保持规律作息，避免过度劳累。"
                ]
        else:
            if is_weekend:
                advices = [
                    f"周末运势低迷，{sign_info['name']}适合独处或休息，避免复杂的社交活动。",
                    f"今天{sign_info['name']}可能感到能量不足，建议进行冥想或轻松活动，恢复内在平衡。",
                    f"周末低能量日，建议{sign_info['name']}减少外出，专注于自我照顾和恢复。"
                ]
            else:
                advices = [
                    f"工作日运势低迷，{sign_info['name']}应避免重大决策或冲突，专注于日常任务。",
                    f"今天{sign_info['name']}可能面临挑战，建议保持低调，避免引起不必要的注意。",
                    f"工作日低能量，建议{sign_info['name']}优先处理简单任务，推迟复杂或重要的事务。"
                ]
        
        # 添加针对性建议
        specific_advices = []
        
        # 爱情建议
        if scores["love"] <= 2:
            specific_advices.append(f"感情方面：今天不适合进行重要的感情对话或决定，给自己和伴侣一些空间。")
        elif scores["love"] >= 4:
            specific_advices.append(f"感情方面：今天是表达爱意或增进感情的好时机，可以安排一次浪漫约会或送一份小礼物。")
        
        # 事业建议
        if scores["career"] <= 2:
            specific_advices.append(f"事业方面：今天工作中可能遇到阻碍，建议专注于细节，避免冲突，保持耐心。")
        elif scores["career"] >= 4:
            specific_advices.append(f"事业方面：今天是展示才能和争取机会的好时机，可以主动承担责任或提出创新想法。")
        
        # 健康建议
        if scores["health"] <= 2:
            specific_advices.append(f"健康方面：今天身体可能较为疲惫，建议增加休息，避免剧烈运动，注意保暖。")
        elif scores["health"] >= 4:
            specific_advices.append(f"健康方面：今天精力充沛，适合进行体育锻炼或开始新的健康习惯。")
        
        # 财富建议
        if scores["wealth"] <= 2:
            specific_advices.append(f"财富方面：今天财运不佳，建议控制支出，避免投资和大额消费，保持财务谨慎。")
        elif scores["wealth"] >= 4:
            specific_advices.append(f"财富方面：今天财运亨通，适合进行合理投资或规划财务，可能有意外收入。")
        
        # 合并建议
        main_advice = random.choice(advices)
        all_advices = [main_advice] + specific_advices
        
        return all_advices

# 使用示例
if __name__ == "__main__":
    zodiac = ZodiacFortune()
    result = zodiac.generate_daily_horoscope(
        birth_date="1990-01-15",
        target_date="2025-05-28"
    )
    print(result)
